<!DOCTYPE html>
<html xmlns:th="http://www.springframework.org/schema/jdbc" xmlns:v-on="http://www.w3.org/1999/xhtml">
<div th:replace="/common/header :: header"></div>
<body >

<div class="login_bac" id="app">
    <div class="reg_warp">
        <img src="images/logo.png" class="login_img">
        <div class="lg_tit clearfix">
<!--            <i class="lg_tfl"></i>-->
            <p class="lg_sign" style="width: 440px;">The Terms Of Service</p>
<!--            <i class="lg_tfr"></i>-->
        </div>
        <p class="reg_tit">服务条款页面,内容待更新</p>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>


    </div>

    <div class="reg_bot">
        <div class="clearfix lg_boa">
            <a href="#">Contact Us</a>
            <a href="#">About Us</a>
            <a href="#">Readme Before Use</a>
        </div>
        <p class="lg_boits">@Better Price Better Go</p>
    </div>
</div>


<script  th:inline="javascript">
    /*加载layui组件*/
    layui.use([ 'laydate', 'laypage', 'layer', 'form', 'carousel', 'upload',
        'element' ], function() {
        var laydate = layui.laydate //日期
            , laypage = layui.laypage //分页
            , layer = layui.layer //弹层
            , form = layui.form //表格
            , carousel = layui.carousel //轮播
            , upload = layui.upload //上传
            , element = layui.element; //元素操作
        form.on('select(carrier)', function(data){
            data.value==3 ? $("#carrier_name").show() : $("#carrier_name").hide();
            formData.role_id = data.value
        });

    });

    /*thymealef中获取接口url*/
    var save_url = [[${save_url}]];

    /*定义vue*/
    var formData = new Vue({
        el : '#app',
        data : {
            user_email:"",
            role_id:5,
            password:"",
            phone:"",
            avatar:"",
            confirm_password:'',
            carrier_name:''
        },
        methods: {
            save: function(){
                // console.log(this.password);
                var index = layer.msg('提交中，请稍候', {
                    icon : 16,
                    time : false,
                    shade : 0.8
                });
                $.ajax({
                    url:[[${save_url}]],
                    type:"POST",
                    data:{
                        user_email:	formData.user_email,
                        role_id:		formData.role_id,
                        password:	formData.password,
                        phone:		formData.phone,
                        avatar:		formData.avatar,
                        carrier_name:formData.carrier_name
                    },
                    success:function(d){
                        layer.closeAll();
                        // console.log("code="+d.code);
                        if(d.code == 0){
                            layer.confirm('注册成功,是否跳转登陆页面?', {
                                btn: ['YES','NO'] //按钮
                            }, function(){
                                location.href = "/login.html"//登录成功，页面跳转登陆页面
                            }, function(){

                            });

                        }else{
                            layer.alert(d.msg);
                        }
                    },
                    error:function(){
                        layer.closeAll();
                        layer.alert("error");
                    }
                });

            }
        }

    });


</script>

</body>
</html>
